package com.mew.lobby.provide;

import com.mew.common.rest.gold.*;
import com.mew.common.rest.user.UserMoneyResponseMessage;
import com.mew.common.rest.user.BuyRequestMessage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;


@Component
@FeignClient(value = "mew-kernel-user")
public interface GoldFeignService {

    @PostMapping(value = "/goldrank/richman")
    @ResponseBody
    GoldRankPlayersMessage richman(@RequestParam("uid") long uid, @RequestParam("type")int type);

    @GetMapping(value = "/tran/customers")
    @ResponseBody
    CustomerResponse customers();

    @GetMapping(value = "/tran/customerInfo/{uid}/{toUid}")
    @ResponseBody
    int customerInfo(@RequestParam("uid") long uid, @RequestParam("toUid")Long toUid);

    @GetMapping(value = "/tran/tran/{uid}/{toUid}/{goldNumber}")
    @ResponseBody
    TranResponse tran(@PathVariable("uid")long uid, @PathVariable("toUid")long toUid, @PathVariable("goldNumber")long goldNumber);

    @GetMapping(value = "/tran/record/{uid}/{tranType}")
    @ResponseBody
    TranRecordResponse tranRecord(@RequestParam("uid")long uid, @RequestParam("tranType")int tranType);

    @GetMapping(value = "/buy/info")
    @ResponseBody
    GoldBuyMessage info();

    @PostMapping(value = "/buy/gold")
    @ResponseBody
    UserMoneyResponseMessage gold(@RequestParam("uid")long uid,@RequestParam("type")int type);

    @PostMapping(value = "/buy/gold2")
    @ResponseBody
    UserMoneyResponseMessage gold2(@RequestParam("uid")long uid,@RequestParam("num")long num);

    @PostMapping(value = "/buy/jewelNumber")
    @ResponseBody
    UserMoneyResponseMessage jewelNumber(BuyRequestMessage req);

}
